package think.thread.sychron.c02.toast;

public class Toast {

	public enum State {
		DRY, BUTTERED, JAMMED
	};

	private State t = State.DRY;
	private final int id;

	public void butter() {
		t = State.BUTTERED;
	}

	public void jam() {
		t = State.JAMMED;
	}

	public State getStates() {
		return t;
	}

	public Toast(int id) {
		this.id = id;
	}

	public int getId() {
		return id;
	}

	public String toString() {
		return "Toast " + id + ": " + t;
	}

}
